package com.spq.paramsverify.req;

import com.spq.paramsverify.maker.Add;
import com.spq.paramsverify.maker.Update;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @Description TODO
 * @Author gongjianpeng
 * @Date 2022/1/19
 */
@Data
public class AddOrEditStudentReq implements Serializable {

    @NotNull(message = "id不能为空",groups = {Update.class})
    private Long id;

    @NotBlank(message = "姓名不能为空",groups = {Update.class, Add.class})
    private String name;

    @Max(value = 150,message = "年龄不能大于150")
    @Min(value = 0,message = "年龄不能小于0")
    private Short age;

    @NotBlank(message = "性别不能为空",groups = {Update.class, Add.class})
    private String sex;

    private String interest;
}
